home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Macintosh Sample Code / For MPW 3.1 Users
Encoding:
Text File  |  1990-03-06  |  4.2 KB  |  134 lines  |  [TEXT/MPS ]

  1. Dear Leading Edge Developer:
  2.  
  3. Thank you for spending the big bucks and upgrading to MPW 3.1. Unfortunately,
  4. we're too poor here in DTS-land to get MPW 3.1, which means that all of these
  5. nice source code samples you see don't necessarily work with it. Thanks to the
  6. generosity of a rich uncle whose Golden Parachute just died, we recently gained
  7. access to MPW 3.1 and were able to test things out. This is what we found:
  8.  
  9.  
  10. ==================================
  11. SC.001.Sample
  12. ==================================
  13.  
  14. The assembly version does not compile under MPW 3.1. There is a conflict in
  15. Record names in the file "Sample.inc1.p" (QDGlobals is now defined in
  16. Quick.Equ). Renaming QDGlobals to QuickGlobals in "Sample.inc1.a" and
  17. "Sample.a" fixes the problem.   
  18.  
  19.  
  20. ==================================
  21. SC.003.SillyBalls
  22. ==================================
  23.  
  24. The C version does not compile. This is because the C compiler is now a little
  25. stricter than it used to be. We used to be able to pass Ptrs where WindowPtrs
  26. were needed. This is no longer possible. Change the following line in
  27. SillyBalls.c: 
  28.  
  29.     mainPtr = NewCWindow(nil, &windRect, "\pBo3b Land", true, documentProc, 
  30.                         (Ptr) -1, false, 0);
  31.  
  32. To:
  33.  
  34.     mainPtr = NewCWindow(nil, &windRect, "\pBo3b Land", true, documentProc, 
  35.                         (WindowPtr) -1, false, 0);
  36.  
  37.  
  38. ==================================
  39. SC.004.TubeTest
  40. ==================================
  41.  
  42. CTubeTest.make is checked out read-only, and cannot be changed. To modify it,
  43. use OrphanFiles or ModifyRead only. We highly recommend that you do this, as
  44. the Make options are set up for MPW 2.0. To compile under MPW 3.1, comment out
  45. the COptions line with _ALLNU_, and uncomment out the COptions line MPW3: 
  46.  
  47. COptions = -r -d MPW3
  48. #COptions = -d __ALLNU__
  49.  
  50.  
  51. But that's not enough. There is another Ptr problem. There is a call to
  52. BlockMove() in TubeTest.c that needs to be modified. Change:
  53.  
  54.     BlockMove (&(*destCTab)->ctTable[3], 
  55.                &(*destCTab)->ctTable[2], 
  56.                (numColors) * sizeof(ColorSpec) );                /* copy all one entry down. */
  57.                
  58. to coerce its parameters to Ptrs:
  59.  
  60.     BlockMove ((Ptr)&(*destCTab)->ctTable[3], 
  61.                (Ptr)&(*destCTab)->ctTable[2], 
  62.                (numColors) * sizeof(ColorSpec) );                /* copy all one entry down. */
  63.  
  64.  
  65. You will also have to do that WindowPtr thing again with the following line.
  66. Change: 
  67.  
  68.     myWindow = GetNewCWindow(windowID, nil, (Ptr) -1);
  69.  
  70. To:
  71.  
  72.     myWindow = GetNewCWindow(windowID, nil, (WindowPtr) -1);
  73.  
  74.  
  75. ==================================
  76. SC.013.OOPTESample
  77. ==================================
  78.  
  79. The Pascal got a little tighter, and caught one of those "Passing a >4 byte
  80. value as a  VAR parameter" bugs that got by us. The following line in
  81. TApplication.IApplication (in the file UApplication.inc1.p) is incorrect:  
  82.  
  83.     NEW(fDocList);
  84.     
  85. Instead, declare a temporary variable of type TDocumentList, create one of
  86. those with NEW, and assign it to fDocList: 
  87.     
  88.     VAR
  89.         ...
  90.         aDocList: TDocumentList;
  91.         
  92.     BEGIN
  93.         ...
  94.         New(aDocList);
  95.         fDocList := aDocList;
  96.         ...
  97.     END;
  98.  
  99.  
  100.  
  101. ==================================
  102. SC.015.Offscreen
  103. ==================================
  104.  
  105. In Offscreen.inc1.p, there is a CONST declaration of "chunky" that conflicts
  106. with a newly defined enumerated type in one of the header files. Comment
  107. out "chunky" in "Offscreen.inc1.p": 
  108.  
  109. {    chunky    = 0;}
  110.  
  111. This, however, leads to a problem with the routine called InitGBuffer. At one
  112. point, "chunky" is passed in as a parameter where an INTEGER is required. Now
  113. that chunky is not an integer but an enumerated type, Pascal flags this as an
  114. error. The quick fix is to declare the parameter as an UNIV INTEGER, rather
  115. than as an INTEGER. Change the following declaration:  
  116.  
  117. PROCEDURE InitGBufferPixmap(pmap: PixMapHandle; aBounds: Rect; aPixelType, aPixelSize,
  118.      aCmpCount, aCmpSize: INTEGER; aPMTable: CTabHandle; VAR dataSize: LONGINT);
  119.  
  120. To:
  121.  
  122. PROCEDURE InitGBufferPixmap(pmap: PixMapHandle; aBounds: Rect; aPixelType, aPixelSize,
  123.      aCmpCount, aCmpSize: UNIV INTEGER; aPMTable: CTabHandle; VAR dataSize: LONGINT);
  124.  
  125.  
  126. Also, in Offscreen.p, there is a conflict in TYPE declarations. With MPW 3.0,
  127. we had to manually declare the following types: 
  128.  
  129. TYPE
  130.     BitMapHandle    = ^BitMapPtr;
  131.     BitMapPtr        = ^BitMap;
  132.     
  133. These are now defined in Quickdraw.p, so you can comment these out.
  134.